import axios from 'axios';
let URL = 'http://192.168.3.102:8080';
const LOGIN_URL = URL.concat('/member/login/');//登录地址
const GETWEATHER_URL = URL.concat('/getClientInfo/getCityInfo/');//获取天气
const GETROLESBYNAME_URL = URL.concat('/roleMember/getRoleMember/');//根据登录名称获取角色
const ADDUSER_URL = URL.concat('/member/addMember');//添加用户
const ADDVIDEO_URL = URL.concat('/video/addVideo');//添加摄像头及目录
const SEARCHVIDEOINFOTHIRD_URL = URL.concat('/video/videoSearch/');//搜索摄像头
const VIDEOLIST_URL = URL.concat('/video/getVideo/');//添加摄像头及目录
const DELETEVIDEO_URL = URL.concat('/video/videoDelete');//删除摄像头或目录
const UPDATEVIDEO_URL = URL.concat('/video/videoUpdate');//修改摄像头目录名称
const ADDROLE_URL = URL.concat('/role/addRole');//角色添加
const GETROLE_URL = URL.concat('/role/getRole/');//获取所有角色
const UPDATEROLE_URL = URL.concat('/role/updateRole');//角色更新
const DELETEROLE_URL = URL.concat('/role/deleteRole');//角色删除
const ADDORG_URL = URL.concat('/organization/addOrganization');//部门添加
const GETORG_URL = URL.concat('/organization/getOrganization/');//获取所有部门
const DELETEORG_URL = URL.concat('/organization/deleteOrganization');//部门删除
const UPDATEORG_URL = URL.concat('/organization/updateOrganization');//部门更新
const GETMEN_URL = URL.concat('/member/getMember/');//获取人员
const DELETEMEN_URL = URL.concat('/member/deleteMember');//人员删除
const ADDMENORG_URL = URL.concat('/roleMember/addRoleMember');//人员角色添加
const GETSELECTORLES_URL = URL.concat('/roleMember/getRoleMember/');//根据人员获取选中角色
const UPDATEUSERINFO_URL = URL.concat('/member/updateMember');//修改用户信息
const ADDOPERATION_URL = URL.concat('/operation/addOperation');//权限添加
const GETOPERATION_URL = URL.concat('/operation/getOperation/');//获取权限
const DELETEOPERATION_URL = URL.concat('/operation/deleteOperation');//权限删除
const UPDATEOPERATION_URL = URL.concat('/operation/updateOperation');//权限更新
const ADDROLEOPERATION_URL = URL.concat('/roleOperation/addRoleOperation');//角色权限添加

export const addVideoInfo = params => {
  return axios.post(ADDVIDEO_URL, params);
};

export const VideoInfoseach = params => {
  return axios.get(SEARCHVIDEOINFOTHIRD_URL.concat(params));
};

export const deleteVideoInfo = params => {
  return axios.put(DELETEVIDEO_URL, params);
};
export const UpdatevideoInfo = params => {
  return axios.put(UPDATEVIDEO_URL, params);
};
// export const requestLogin1 = params => {
//   return axios.get(LOGIN_URL, {params: params});
// };

export const requestLogin = params => {
  return axios.get(LOGIN_URL.concat(params));
};
export const requestWeather = params => {
  return axios.get(GETWEATHER_URL.concat(params));
};

export const adduser = params => {
  return axios.post(ADDUSER_URL, params);
};

export const getVideolist = params => {
  return axios.get(VIDEOLIST_URL.concat(params));
};

export const addroleInfo = params => {
  return axios.post(ADDROLE_URL, params);
};

export const getrolelist = params => {
  return axios.get(GETROLE_URL.concat(params));
};

export const updateRoleInfo = params => {
  return axios.put(UPDATEROLE_URL, params);
};

export const deleteRoleInfo = params => {
  return axios.put(DELETEROLE_URL, params);
};

export const addorgnfo = params => {
  return axios.post(ADDORG_URL, params);
};
export const getORGlist = params => {
  return axios.get(GETORG_URL.concat(params));
};
export const updateORGInfo = params => {
  return axios.put(UPDATEORG_URL, params);
};
export const deleteORGInfo = params => {
  return axios.put(DELETEORG_URL, params);
};

export const getMenlist = params => {
  return axios.get(GETMEN_URL.concat(params));
};

export const DeleteMenInfo = params => {
  return axios.put(DELETEMEN_URL, params);
};
export const addMenroleInfo = params => {
  return axios.post(ADDMENORG_URL, params);
};

export const getSelectRolelist = params => {
  return axios.get(GETSELECTORLES_URL.concat(params));
};

export const updateuserInfo = params => {
  return axios.put(UPDATEUSERINFO_URL, params);
};

export const addoperationInfo = params => {
  return axios.post(ADDOPERATION_URL, params);
};

export const getoperationlist = params => {
  return axios.get(GETOPERATION_URL.concat(params));
};

export const DeleteoperationInfo = params => {
  return axios.put(DELETEOPERATION_URL, params);
};

export const updateoperationInfo = params => {
  return axios.put(UPDATEOPERATION_URL, params);
};

export const addRoleoperationInfo = params => {
  return axios.post(ADDROLEOPERATION_URL, params);
};

// export const getRoleoperationlist = params => {
//   return axios.get(GETOPERATION_URL.concat(params));
// };
export const getRoleByname = params => {
  return axios.get(GETROLESBYNAME_URL.concat(params));
};
